package com.betterjr.modules.customer.entity;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.betterjr.common.annotation.MetaData;
import com.betterjr.common.entity.BetterjrEntity;
import com.betterjr.common.mapper.CustDateJsonSerializer;
import com.betterjr.common.mapper.CustTimeJsonSerializer;
import com.betterjr.common.selectkey.SerialGenerator;
import com.betterjr.common.utils.BetterDateUtils;
import com.betterjr.common.utils.UserUtils;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@Access(AccessType.FIELD)
@Entity
@Table(name = "t_scf_cust_connect_config")
public class CustBaseConfigure implements BetterjrEntity {

    /** 
     * @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么) 
     */
    private static final long serialVersionUID = -5209492244317397756L;

    @Id
    @Column(name = "ID", columnDefinition = "INTEGER")
    @MetaData(value = "配置id", comments = "配置id")
    private Long id;

    @Column(name = "L_CUSTNO", columnDefinition = "INTEGER")
    @MetaData(value = "客户编号", comments = "客户编号")
    private Long custNo;

    @Column(name = "C_CUSTNAME", columnDefinition = "VARCHAR")
    @MetaData(value = "客户名称", comments = "客户名称")
    private String custName;

    @Column(name = "C_OPERORG", columnDefinition = "VARCHAR")
    @MetaData(value = "操作机构", comments = "操作机构")
    private String operOrg;

    @Column(name = "C_SYSTEM_IDENTIFITION", columnDefinition = "VARCHAR")
    @MetaData(value = "系统标识", comments = "系统标识")
    private String systemIdentifition;

    @Column(name = "C_CUST_IDENTIFITION", columnDefinition = "VARCHAR")
    @MetaData(value = "客户标识", comments = "客户标识")
    private String custIdentifition;

    @Column(name = "C_SERVICE_URL", columnDefinition = "VARCHAR")
    @MetaData(value = "服务器地址", comments = "服务器地址")
    private String servicerUrl;

    @Column(name = "C_ENCORD_MODE", columnDefinition = "VARCHAR")
    @MetaData(value = "加密方式", comments = "加密方式")
    private String encryptMay;

    /*类型： 1 企e金服前置系统配置  2资金管理云平台配置 3 拜特资金管理系统配置*/
    @Column(name = "C_TYPE", columnDefinition = "VARCHAR")
    @MetaData(value = "服务类型", comments = "服务类型")
    private String servicerType;

    @Column(name = "C_BUSINSTATUS", columnDefinition = "VARCHAR")
    @MetaData(value = "商业状态", comments = "商业状态")
    private String businStatus;

    @Column(name = "C_MODIFY_OPERATORNAME", columnDefinition = "VARCHAR")
    @MetaData(value = "修改人名称", comments = "修改人名称")
    private String modifyOperatorName;

    @Column(name = "L_MODIFY_OPERATORID", columnDefinition = "INTEGER")
    @MetaData(value = "修改人ID", comments = "修改人Id")
    private Long modifyOperatorId;

    @JsonSerialize(using = CustDateJsonSerializer.class)
    @Column(name = "C_MODIFY_DATE", columnDefinition = "VARCHAR")
    @MetaData(value = "修改日期", comments = "修改日期")
    private String modifyDate;

    @JsonSerialize(using = CustTimeJsonSerializer.class)
    @Column(name = "C_MODIFY_TIME", columnDefinition = "VARCHAR")
    @MetaData(value = "时间", comments = "时间")
    private String modifyTime;

    /**
     * 云系统标识
     */
    @Column(name = "C_COULD_IDTIFITION", columnDefinition = "VARCHAR")
    @MetaData(value = "云系统标识", comments = "云系统标识")
    private String couldIdtifition;

    public Long getId() {
        return id;
    }

    public void setId(Long anId) {
        id = anId;
    }

    public Long getCustNo() {
        return custNo;
    }

    public void setCustNo(Long anCustNo) {
        custNo = anCustNo;
    }

    public String getCustName() {
        return custName;
    }

    public void setCustName(String anCustName) {
        custName = anCustName;
    }

    public String getOperOrg() {
        return operOrg;
    }

    public void setOperOrg(String anOperOrg) {
        operOrg = anOperOrg;
    }

    public String getSystemIdentifition() {
        return systemIdentifition;
    }

    public void setSystemIdentifition(String anSystemIdentifition) {
        systemIdentifition = anSystemIdentifition;
    }

    public String getCustIdentifition() {
        return custIdentifition;
    }

    public void setCustIdentifition(String anCustIdentifition) {
        custIdentifition = anCustIdentifition;
    }

    public String getServicerUrl() {
        return servicerUrl;
    }

    public void setServicerUrl(String anServicerUrl) {
        servicerUrl = anServicerUrl;
    }

    public String getEncryptMay() {
        return encryptMay;
    }

    public void setEncryptMay(String anEncryptMay) {
        encryptMay = anEncryptMay;
    }

    public String getServicerType() {
        return servicerType;
    }

    public void setServicerType(String anServicerType) {
        servicerType = anServicerType;
    }

    public String getBusinStatus() {
        return businStatus;
    }

    public void setBusinStatus(String anBusinStatus) {
        businStatus = anBusinStatus;
    }

    public String getModifyOperatorName() {
        return modifyOperatorName;
    }

    public void setModifyOperatorName(String anModifyOperatorName) {
        modifyOperatorName = anModifyOperatorName;
    }

    public Long getModifyOperatorId() {
        return modifyOperatorId;
    }

    public void setModifyOperatorId(Long anModifyOperatorId) {
        modifyOperatorId = anModifyOperatorId;
    }

    public String getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(String anModifyDate) {
        modifyDate = anModifyDate;
    }

    public String getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(String anModifyTime) {
        modifyTime = anModifyTime;
    }

    public static long getSerialversionuid() {
        return serialVersionUID;
    }

    public String getCouldIdtifition() {
        return couldIdtifition;
    }

    public void setCouldIdtifition(String anCouldIdtifition) {
        couldIdtifition = anCouldIdtifition;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (businStatus == null ? 0 : businStatus.hashCode());
        result = prime * result + (custIdentifition == null ? 0 : custIdentifition.hashCode());
        result = prime * result + (custName == null ? 0 : custName.hashCode());
        result = prime * result + (custNo == null ? 0 : custNo.hashCode());
        result = prime * result + (encryptMay == null ? 0 : encryptMay.hashCode());
        result = prime * result + (id == null ? 0 : id.hashCode());
        result = prime * result + (modifyDate == null ? 0 : modifyDate.hashCode());
        result = prime * result + (modifyOperatorId == null ? 0 : modifyOperatorId.hashCode());
        result = prime * result + (modifyOperatorName == null ? 0 : modifyOperatorName.hashCode());
        result = prime * result + (modifyTime == null ? 0 : modifyTime.hashCode());
        result = prime * result + (operOrg == null ? 0 : operOrg.hashCode());
        result = prime * result + (servicerType == null ? 0 : servicerType.hashCode());
        result = prime * result + (servicerUrl == null ? 0 : servicerUrl.hashCode());
        result = prime * result + (systemIdentifition == null ? 0 : systemIdentifition.hashCode());
        result = prime * result + (couldIdtifition == null ? 0 : couldIdtifition.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        final CustBaseConfigure other = (CustBaseConfigure) obj;
        if (businStatus == null) {
            if (other.businStatus != null) return false;
        } else if (!businStatus.equals(other.businStatus)) return false;
        if (custIdentifition == null) {
            if (other.custIdentifition != null) return false;
        } else if (!custIdentifition.equals(other.custIdentifition)) return false;
        if (custName == null) {
            if (other.custName != null) return false;
        } else if (!custName.equals(other.custName)) return false;
        if (custNo == null) {
            if (other.custNo != null) return false;
        } else if (!custNo.equals(other.custNo)) return false;
        if (encryptMay == null) {
            if (other.encryptMay != null) return false;
        } else if (!encryptMay.equals(other.encryptMay)) return false;
        if (id == null) {
            if (other.id != null) return false;
        } else if (!id.equals(other.id)) return false;
        if (modifyDate == null) {
            if (other.modifyDate != null) return false;
        } else if (!modifyDate.equals(other.modifyDate)) return false;
        if (modifyOperatorId == null) {
            if (other.modifyOperatorId != null) return false;
        } else if (!modifyOperatorId.equals(other.modifyOperatorId)) return false;
        if (modifyOperatorName == null) {
            if (other.modifyOperatorName != null) return false;
        } else if (!modifyOperatorName.equals(other.modifyOperatorName)) return false;
        if (modifyTime == null) {
            if (other.modifyTime != null) return false;
        } else if (!modifyTime.equals(other.modifyTime)) return false;
        if (operOrg == null) {
            if (other.operOrg != null) return false;
        } else if (!operOrg.equals(other.operOrg)) return false;
        if (servicerType == null) {
            if (other.servicerType != null) return false;
        } else if (!servicerType.equals(other.servicerType)) return false;
        if (servicerUrl == null) {
            if (other.servicerUrl != null) return false;
        } else if (!servicerUrl.equals(other.servicerUrl)) return false;
        if (systemIdentifition == null) {
            if (other.systemIdentifition != null) return false;
        } else if (!systemIdentifition.equals(other.systemIdentifition)) return false;
        if (couldIdtifition == null) {
            if (other.couldIdtifition != null) return false;
        } else if (!couldIdtifition.equals(other.couldIdtifition)) return false;
        return true;
    }

    @Override
    public String toString() {
        return "CustBaseConfigure [id=" + id + ", custNo=" + custNo + ", custName=" + custName + ", operOrg=" + operOrg
                + ", systemIdentifition=" + systemIdentifition + ", custIdentifition=" + custIdentifition
                + ", servicerUrl=" + servicerUrl + ", encryptMay=" + encryptMay + ", servicerType=" + servicerType
                + ", businStatus=" + businStatus + ", modifyOperatorName=" + modifyOperatorName + ", modifyOperatorId="
                + modifyOperatorId + ", modifyDate=" + modifyDate + ", modifyTime=" + modifyTime + ", couldIdtifition="
                + couldIdtifition + "]";
    }

    public void initValue() {
        this.id = SerialGenerator.getLongValue("CustBaseConfigure.id");
        this.businStatus = "1";
        this.modifyOperatorId = UserUtils.getOperatorInfo().getId();
        this.modifyOperatorName = UserUtils.getOperatorInfo().getName();
        this.operOrg = UserUtils.getOperatorInfo().getOperOrg();
        this.modifyDate = BetterDateUtils.getNumDate();
        this.modifyTime = BetterDateUtils.getNumTime();
    }

}
